<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta name="generator" content="Doxygen 1.8.16" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>LEAF: LEAF</title>
    <link href="tabs.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript" src="dynsections.js"></script>
    <script type="text/javascript" src="../js/iframeResizer.contentWindow.min.js"></script>
    <!-- <script src="/js/template.js"></script> -->
     <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script> 
    <link href="doxygen.css" rel="stylesheet" type="text/css" />
    <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
    <!-- <link rel="stylesheet" href="/css/tachyons.css" type="text/css" /> -->
</head>
<body class="bg-washed-green black-70 ph0 sans-serif" onload="iframeResizePipe()">
    <div>
        <!-- do not remove this div, it is closed by doxygen! -->
        <div id="titlearea">
            <table cellspacing="0" cellpadding="0">
                <tbody>
                    <tr>
                    </tr>
                </tbody>
            </table>
        </div>
        <!-- end header part -->
    </div>
</body>
</html><!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a>  </div>
  <div class="headertitle">
<div class="title">LEAF</div>  </div>
</div><!--header-->
<div class="contents">

<p>The structure of an instance of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_l_e_a_f.html">LEAF</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Struct for an instance of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>.  <a href="struct_l_e_a_f.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga13fefd14706bd5d85346066660f3c9eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__leaf.html#ga13fefd14706bd5d85346066660f3c9eb">LEAF_init</a> (<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const leaf, float sampleRate, int blockSize, char *memory, size_t memorySize, float(*random)(void))</td></tr>
<tr class="memdesc:ga13fefd14706bd5d85346066660f3c9eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> instance.  <a href="group__leaf.html#ga13fefd14706bd5d85346066660f3c9eb">More...</a><br /></td></tr>
<tr class="separator:ga13fefd14706bd5d85346066660f3c9eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab84d5b2ad600cc920248996c86b72f9f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__leaf.html#gab84d5b2ad600cc920248996c86b72f9f">LEAF_setSampleRate</a> (<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const leaf, float sampleRate)</td></tr>
<tr class="memdesc:gab84d5b2ad600cc920248996c86b72f9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the sample rate of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>.  <a href="group__leaf.html#gab84d5b2ad600cc920248996c86b72f9f">More...</a><br /></td></tr>
<tr class="separator:gab84d5b2ad600cc920248996c86b72f9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf680c38a6e3234739e57391650dea267"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__leaf.html#gaf680c38a6e3234739e57391650dea267">LEAF_getSampleRate</a> (<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const leaf)</td></tr>
<tr class="memdesc:gaf680c38a6e3234739e57391650dea267"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the sample rate of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>.  <a href="group__leaf.html#gaf680c38a6e3234739e57391650dea267">More...</a><br /></td></tr>
<tr class="separator:gaf680c38a6e3234739e57391650dea267"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6ad73444bc6f242c30a83bddbd120052"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__leaf.html#ga6ad73444bc6f242c30a83bddbd120052">LEAF_defaultErrorCallback</a> (<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const leaf, LEAFErrorType errorType)</td></tr>
<tr class="memdesc:ga6ad73444bc6f242c30a83bddbd120052"><td class="mdescLeft">&#160;</td><td class="mdescRight">The default callback function for <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> errors.  <a href="group__leaf.html#ga6ad73444bc6f242c30a83bddbd120052">More...</a><br /></td></tr>
<tr class="separator:ga6ad73444bc6f242c30a83bddbd120052"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga046f5f075ebc4562b8e2d97de4b69536"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__leaf.html#ga046f5f075ebc4562b8e2d97de4b69536">LEAF_setErrorCallback</a> (<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const leaf, void(*callback)(<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const, LEAFErrorType))</td></tr>
<tr class="memdesc:ga046f5f075ebc4562b8e2d97de4b69536"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the callback function for <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> errors.  <a href="group__leaf.html#ga046f5f075ebc4562b8e2d97de4b69536">More...</a><br /></td></tr>
<tr class="separator:ga046f5f075ebc4562b8e2d97de4b69536"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The structure of an instance of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga13fefd14706bd5d85346066660f3c9eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga13fefd14706bd5d85346066660f3c9eb">&#9670;&nbsp;</a></span>LEAF_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LEAF_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_l_e_a_f.html">LEAF</a> *const&#160;</td>
          <td class="paramname"><em>leaf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>sampleRate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>blockSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>memory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>memorySize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float(*)(void)&#160;</td>
          <td class="paramname"><em>random</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sampleRate</td><td>The audio sample rate. </td></tr>
    <tr><td class="paramname">blockSize</td><td>The audio block size. </td></tr>
    <tr><td class="paramname">memory</td><td>A pointer to the memory that will make up the default mempool of a <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> instance. </td></tr>
    <tr><td class="paramname">memorySize</td><td>The size of the memory that will make up the default mempool of a <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> instance. </td></tr>
    <tr><td class="paramname">random</td><td>A pointer to a random number function. Should return a float &gt;= 0 and &lt; 1. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="basic-oscillators_8c-example.html#a1">basic-oscillators.c</a>.</dd>
</dl>

</div>
</div>
<a id="gab84d5b2ad600cc920248996c86b72f9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab84d5b2ad600cc920248996c86b72f9f">&#9670;&nbsp;</a></span>LEAF_setSampleRate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LEAF_setSampleRate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_l_e_a_f.html">LEAF</a> *const&#160;</td>
          <td class="paramname"><em>leaf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>sampleRate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the sample rate of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sampleRate</td><td>The new audio sample rate. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaf680c38a6e3234739e57391650dea267"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf680c38a6e3234739e57391650dea267">&#9670;&nbsp;</a></span>LEAF_getSampleRate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float LEAF_getSampleRate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_l_e_a_f.html">LEAF</a> *const&#160;</td>
          <td class="paramname"><em>leaf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the sample rate of <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a>. </p>
<dl class="section return"><dt>Returns</dt><dd>The current sample rate as a float. </dd></dl>

</div>
</div>
<a id="ga6ad73444bc6f242c30a83bddbd120052"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ad73444bc6f242c30a83bddbd120052">&#9670;&nbsp;</a></span>LEAF_defaultErrorCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LEAF_defaultErrorCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_l_e_a_f.html">LEAF</a> *const&#160;</td>
          <td class="paramname"><em>leaf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">LEAFErrorType&#160;</td>
          <td class="paramname"><em>errorType</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The default callback function for <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> errors. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">errorType</td><td>The type of the error that has occurred. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga046f5f075ebc4562b8e2d97de4b69536"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga046f5f075ebc4562b8e2d97de4b69536">&#9670;&nbsp;</a></span>LEAF_setErrorCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void LEAF_setErrorCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_l_e_a_f.html">LEAF</a> *const&#160;</td>
          <td class="paramname"><em>leaf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(<a class="el" href="struct_l_e_a_f.html">LEAF</a> *const, LEAFErrorType)&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the callback function for <a class="el" href="struct_l_e_a_f.html" title="Struct for an instance of LEAF.">LEAF</a> errors. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callback</td><td>A pointer to the callback function. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
</body>
</html>
